package com.dawnling.androidutils.app;

import android.app.Application;

import com.blankj.utilcode.util.Utils;
import com.dawnling.androidutils.typeface.FontUtils;
import com.dawnling.androidutils.typeface.InfoCache;
import com.dawnling.androidutilslib.App;

/**
 * Applicaition
 */
public class MyApplicaition extends App {

    protected static MyApplicaition mInstance;

    public static MyApplicaition getApp() {
        return mInstance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        Utils.init(this);
        //全局替换字体
        if (InfoCache.getTypeface() != null)
            if (!InfoCache.getTypeface().isEmpty())
                FontUtils.getInstance().replaceSystemDefaultFontFromAsset(MyApplicaition.getApp(), InfoCache.getTypeface());
            else
                FontUtils.getInstance().replaceSystemDefaultFontFromAsset(MyApplicaition.getApp(), "microsoftyahei.ttf");
    }
}
